home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gui / muibuilderv11.lha / muibuilder / mb / c / Click.c < prev    next >
C/C++ Source or Header  |  1994-03-06  |  2KB  |  74 lines

  1. #include <libraries/mui.h>
  2. #include <proto/muimaster.h>
  3. #include <clib/exec_protos.h>
  4. #include <exec/memory.h>
  5.  
  6. #ifndef MAKE_ID
  7. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  8. #endif
  9.  
  10. #ifdef _DCC
  11. #define __inline
  12. #endif
  13.  
  14. /*    ExTended KeyButton ( or Eric Totel KeyButton :-) )    */
  15. /*    to use with localization features             */
  16.  
  17. static APTR __inline ETKeyButton(char *text)
  18. {
  19.         return (KeyButton(&text[3], text[1]));
  20. }
  21.  
  22. #include "Click.h"
  23.  
  24. struct ObjApp * CreateApp( void )
  25. {
  26.     struct ObjApp * Object;
  27.  
  28.     if (!(Object = AllocVec( sizeof( struct ObjApp ), MEMF_PUBLIC|MEMF_CLEAR )))
  29.         return( NULL );
  30.  
  31.     Object->STR_TX_label_0 = "\0338\033cClick on buttons";
  32.  
  33.     Object->App = ApplicationObject,
  34.         MUIA_Application_Author, "Eric Totel",
  35.         MUIA_Application_Base, "CLICK",
  36.         MUIA_Application_Title, "Click",
  37.         MUIA_Application_Version, "$VER : Click 1.0",
  38.         MUIA_Application_Copyright, "Eric Totel 1994",
  39.         MUIA_Application_Description, "just a demo !!!",
  40.         SubWindow, Object->WI_try = WindowObject,
  41.             MUIA_Window_Title, "Click !!!",
  42.             MUIA_Window_ID, MAKE_ID( '0','W','I','N' ),
  43.             WindowContents, GroupObject,
  44.                 Child, Object->TX_label_0 = TextObject,
  45.                     MUIA_Background, 131,
  46.                     MUIA_Text_Contents, Object->STR_TX_label_0,
  47.                     MUIA_Text_SetMax, 0,
  48.                     MUIA_Text_SetMin, 1,
  49.                     MUIA_Frame, 9,
  50.                 End,
  51.                 Child, GroupObject,
  52.                     MUIA_Group_Horiz, TRUE,
  53.                     MUIA_Group_SameWidth, TRUE,
  54.                     Child, Object->BT_1stbutton = KeyButton( "Button 1",'1' ),
  55.                     Child, Object->BT_2ndbutton = KeyButton( "Button 2",'2' ),
  56.                     Child, Object->BT_3rdbutton = KeyButton( "Button 3",'3' ),
  57.                 End,
  58.             End,
  59.         End,
  60.     End;
  61.  
  62.     if (!(Object->App))
  63.     {
  64.         FreeVec(Object);
  65.         Object = NULL;
  66.     }
  67.     return( Object );
  68. }
  69.  
  70. void DisposeApp( struct ObjApp * Object )
  71. {
  72.     MUI_DisposeObject(Object->App);
  73.     FreeVec( Object );
  74. }